package httydgame;

import java.awt.Rectangle;

public class Projectile {
	private int x, y, speedX; 
	private boolean visible;
	public Rectangle rect = new Rectangle(0,0,0,0);
	
	public Projectile(int startX, int startY, int speed)
	{
		x = startX; 
		y = startY;
		speedX = speed;
		visible = true;
	}
	
	public void update()
	{
		if (x <= 800)
		{
			x += speedX; 
			rect.setRect(x+25, y + 25, 50, 50);
		}
		else
		{
			visible = false;
		}
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public int getSpeedX() {
		return speedX;
	}

	public void setSpeedX(int speedX) {
		this.speedX = speedX;
	}

	public boolean isVisible() {
		return visible;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}
}
